<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>用户管理管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
            $("#btnExport").click(function(){
                top.$.jBox.confirm("确认要导出用户数据吗？","系统提示",function(v,h,f){
                    if(v=="ok"){
                        $("#searchForm").attr("action","${ctx}/sys/user/hkUser/export");
                        $("#searchForm").submit();
                    }
                },{buttonsFocus:1});
                top.$('.jbox-body .jbox-icon').css('top','55px');
            });
		});


		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
        function getIds() {
            var ids = [];
            $("input[name='ids']:checked").each(function () {
                ids.push({id:$(this).val(),name:$(this).attr("label")});
            });
           return ids;
        }
	</script>
</head>
<body>
<c:if test="${empty hkUser.checked}">
   <ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/user/hkUser/">用户管理列表</a></li>
		 <shiro:hasPermission name="sys:user:hkUser:edit"><li><a href="${ctx}/sys/user/hkUser/form">用户管理添加</a></li></shiro:hasPermission>
	</ul>
</c:if>
	<form:form id="searchForm" modelAttribute="hkUser" action="${ctx}/sys/user/hkUser/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="checked" name="checked" type="hidden" value="${hkUser.checked}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>名称：</label>
				<form:input path="name" htmlEscape="false" maxlength="200" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
				<input id="btnExport" class="btn btn-primary" type="button" value="导出"/>

			</li>
			<li class="clearfix"></li>
		</ul>
	</form:form>

	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<c:if test="${not empty hkUser.checked}">
					<th>选择</th>
				</c:if>
				<th>名称</th>
				<th>头像</th>
				<th>状态</th>
				<th>等级</th>
				<th>手机号</th>
				<th>地址</th>
				<th>公司名称</th>
				<th>登录时间</th>
				<th>注册时间</th>
				<th>备注</th>
				<c:if test="${ empty hkUser.checked}">
				<shiro:hasPermission name="sys:user:hkUser:edit"><th>操作</th></shiro:hasPermission>
				</c:if>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="hkUser2">
		<tr>
			<c:if test="${not empty hkUser.checked}">
				<td>
					<input type="checkbox" name="ids" value="${hkUser2.id}" label="${hkUser2.name}">
				</td>
			</c:if>
			<td>
				<c:if test="${not empty hkUser.checked}">
					${hkUser2.name}
				</c:if>
				<c:if test="${ empty hkUser.checked}">
					<a href="${ctx}/sys/user/hkUser/form?id=${hkUser2.id}">
							${hkUser2.name}
						</a>
					</c:if>
				</td>
				<td>
						 <img src="${hkUser2.headImg}" width="60px"/>
				</td>
				<td>
						${fns:getDictLabel(hkUser2.state, 'yes_no', '')}
				</td>
				<td>
					${hkUser2.level}
				</td>
				<td>
						${hkUser2.mobile}
				</td>
				<td>
						${hkUser2.address}
				</td>
				<td>
						${hkUser2.companyName}
				</td>
				<td>
					<fmt:formatDate value="${hkUser2.loginTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					<fmt:formatDate value="${hkUser2.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${hkUser2.remarks}
				</td>
				<c:if test="${ empty hkUser.checked}">
				<shiro:hasPermission name="sys:user:hkUser:edit"><td>
					<a href="${ctx}/sys/user/hkUser/savepassword?id=${hkUser2.id}" onclick="return promptx('确认要重置密码吗？','密码',this.href)">重置密码</a>
    				<a href="${ctx}/sys/user/hkUser/form?id=${hkUser2.id}">修改</a>
					<a href="${ctx}/sys/user/hkUser/delete?id=${hkUser2.id}" onclick="return confirmx('确认要删除该用户管理吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
				</c:if>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>